var mongodb = require('./mongodb');

var Schema = mongodb.mongoose.Schema;

var UserSchema = new Schema({
    userName: {type: 'String', required: true},
    realName: {type: 'String', required: true},
    password: {type: 'String', required: true},
    email: {type: 'String', required: false},
    phone: {type: 'String', required: false},
    createTime: { type: Date, default: Date.now},
    status: {type: 'Number', default: 0, required: true, min: 0, max: 2}//0 enable,1 disable
}, {
    collection: "users"
});


module.exports = mongodb.mongoose.model("User", UserSchema);